package com.atguigu.jxc.controller;

import com.atguigu.jxc.domain.ServiceVO;
import com.atguigu.jxc.entity.ReturnList;
import com.atguigu.jxc.entity.Supplier;
import com.atguigu.jxc.service.ReturnListGoodsService;
import com.atguigu.jxc.service.SupplierService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @description 供应商Controller控制器
 */
@RestController
@RequestMapping("/returnListGoods")
public class ReturnListGoodsController {

    @Autowired
    private ReturnListGoodsService returnListGoodsService;
    /**
     * 下拉查询供应商
     * @return
     */
    @RequestMapping("/save")
//    @RequiresPermissions(value = "供应商管理")
    public ServiceVO getComboboxList(ReturnList returnList, String returnListGoodsStr) {
        return returnListGoodsService.save(returnList,returnListGoodsStr);
    }


    @RequestMapping("/list")
    //    @RequiresPermissions(value = "供应商管理")
    public Map<String, Object> list(String purchaseNumber, Integer supplierId, Integer state, String sTime, String eTime) {
        return returnListGoodsService.list(purchaseNumber, supplierId, state, sTime, eTime);
    }


    @RequestMapping("/goodsList")
    //    @RequiresPermissions(value = "供应商管理")
    public Map<String, Object> goodsList(Integer returnListId) {
        return returnListGoodsService.goodsList(returnListId);
    }

    @RequestMapping("/delete")
    //    @RequiresPermissions(value = "供应商管理")
    public ServiceVO delete(Integer returnListId) {
        return returnListGoodsService.delete(returnListId);
    }


    @RequestMapping("/count")
    //    @RequiresPermissions(value = "供应商管理")
    public String count(String sTime, String eTime ,Integer goodsTypeId, String codeOrName){
        return returnListGoodsService.count(sTime, eTime, goodsTypeId, codeOrName);
    }
}
